/*
 * =====================================================================================
 *
 *       Filename:  tools.c
 *
 *
 *        Created:  09/30/2011 10:39:36 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  durand_y, <durand.yoan@gmail.com>
 *
 * =====================================================================================
 */
#include "tools.h"

int         mystrlen(char   *str)
{
    int     cpt = 0;

    for (; str[cpt] != '\0'; cpt++)
        ;
    return (cpt);
}

int         mystrcmp(char   *str1,
                     char   *str2)
{
    int     i = 0;

    if (mystrlen(str1) != mystrlen(str2))
            return (0);
    else
    {
        while ((str1[i] == str2[i]) && (str1[i] != '\0'))
            i++;

        if (str1[i] == '\0')
            return (1);
        else
            return (0);
    }
}
